#ifndef __LGUIDESKTOP_H__
#define __LGUIDESKTOP_H__

#include "LGUIContainer.h"
#include "LAMEBuffer.h"
//#include "LAMEApp.h"


class LGUIListener 
{
public:
	virtual void onGUIMessage(const LGUIMessage &msg) = 0;
};


class LGUIDesktop : public LGUIContainer  
{
	LGUIListener *listener;
public:
	LGUIDesktop();
	virtual ~LGUIDesktop();

	void draw(int xoff, int yoff);
	void penDown(int px, int py)
	{
		LGUIContainer::penDown(px,py);
		draw(0,0);
		buffer.copy();
	}
	void penMove(int px, int py, bool pressed)
	{
		LGUIContainer::penMove(px,py,pressed);
		draw(0,0);
		buffer.copy();
	}
	void penUp(int px, int py)
	{
		LGUIContainer::penUp(px,py);
		draw(0,0);
		buffer.copy();
	}
	void setListener(LGUIListener *lame)
	{
		listener = lame;
	}
	void deliverMessage(LGUIMessage &msg)
	{
		if (listener)
			listener->onGUIMessage(msg);
	}
};

#endif //__LGUIDESKTOP_H__